package game.actor
{
	import away3d.animators.data.*;
	import away3d.animators.skeleton.*;
	import away3d.core.base.*;
	import away3d.entities.*;
	import engine.asset.*;
	import engine.core.*;
	import engine.graphics.away3d.*;
	import engine.graphics.resources.*;
	import engine.loaders.*;
	import engine.math.*;
	import game.asset.*;
	
	public class RxCharacterPartsAssembler
	{
		private var m_partsTable:RxCharacterPartsTable;
		private var m_skeletonName:String;
		private var m_skeleton:RxAssetCharacter;
		private var m_animationNames:Vector.<String>;
		private var m_animations:Vector.<RxAssetAnimation>;
		private var m_slotDefs:Array;
		private var m_model:RxLoader3D;
		private var m_assemblyCompleteCallback:RxCallback;
		public static const SLOT_BODY:String = "body";
		public static const SLOT_SHOULDERS:String = "shoulders";
		public static const SLOT_HANDS:String = "hands";
		public static const SLOT_FEET:String = "feet";
		public static const SLOT_HEAD:String = "head";
		public static const SLOT_FACE:String = "face";
		public static const SLOT_NAMES:Vector.<String> = new Vector.<String>([SLOT_BODY, SLOT_SHOULDERS, SLOT_HANDS, SLOT_FEET, SLOT_HEAD, SLOT_FACE]);

		
		public function RxCharacterPartsAssembler(partsTable:RxCharacterPartsTable)
		{
			this.m_partsTable = partsTable;
			this.m_skeletonName = "";
			this.m_skeleton = null;
			this.m_animationNames = new Vector.<String>;
			this.m_animations = new Vector.<RxAssetAnimation>;
			this.m_slotDefs = new Array();
			this.m_model = null;
			this.m_assemblyCompleteCallback = null;
		}
		
		public function SetSkeletonName(param1:String) : void
		{
			this.m_skeletonName = param1;
			this.m_skeleton = null;
		}
		
		public function AddAnimationName(param1:String) : void
		{
			this.m_animationNames.push(param1);
		}
		
		public static function IsSlotNameValid(param1:String) : Boolean
		{
			var _loc_2:String = null;
			for each (_loc_2 in SLOT_NAMES)
			{
				
				if (param1 == _loc_2)
				{
					return true;
				}
			}
			return false;
		}
		
		public function SetSlotDefinition(param1:RxCharacterSlotDefinition) : Boolean
		{
			if (!IsSlotNameValid(param1.GetSlotName()))
			{
				return false;
			}
			this.m_slotDefs[param1.GetSlotName()] = param1;
			return true;
		}
	}
}